<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Msgshow extends CI_Controller {

    function __construct() {
        parent::__construct();
        $this->load->helper('url');
        $this->load->database();
        $this->load->helper('func');
    }

    public function index() {
        $sql = "select * from message order by  time  desc limit 5";
        $query = $this->db->query($sql);
        $row = $query->result_array();
        $data['rows'] = $row;
        $this->load->view("front/frameview", $data);
    }

    public function msglist() {
        $sql = "select * from message order by  time  desc limit 10";
        $query = $this->db->query($sql);
        $row = $query->result_array();
        $data['rows'] = $row;
        $this->load->view("front/msglist", $data);
    }

    public function msgdetail() {
        $id = get_segment_fuc(3);
        $sql = "select * from message where id=\"{$id}\"";
        $query = $this->db->query($sql);
        $row = $query->result_array();
        $data['rows'] = $row;
        $this->load->view("front/msgdetail", $data);
    }

}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */